package com.ms.p2p.provider.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ms.common.exception.NoticeException;
import com.ms.p2p.bean.PageBean;
import com.ms.p2p.entity.member.Member;
import com.ms.p2p.provider.MemberProvider;
import com.ms.p2p.service.impl.MemberServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;
import java.util.Map;

/**
 * Created by daimajia on 2015/4/19 添加dubbo接口.
 */
@Service
public class MemberProviderImpl implements MemberProvider {
    @Autowired
    MemberServiceImpl memberService;

    public int updateById(Member member) {
        return memberService.updateById(member);
    }

    public void updateMobilePhoneById(String mobilePhone, Integer id) {
        memberService.updateMobilePhoneById(mobilePhone,id);
    }

    public int insertAndReturnKey(Member member) {
        return memberService.insertAndReturnKey(member);
    }

    public Member findById(int userId) {
        return memberService.findById(userId);
    }

    public Member findByUserName(String userName) {
        return memberService.findByUserName(userName);
    }

    public Member findByMobilePhone(String mobilePhone) {
        return memberService.findByMobilePhone(mobilePhone);
    }

    public Member findByEmail(String email) {
        return memberService.findByEmail(email);
    }

    public Member findByUserNameOrMobilePhoneOrEmail(String str) {
        return memberService.findByUserNameOrMobilePhoneOrEmail(str);
    }

    public List<Map<String, Object>> findPager(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone, PageBean page) {
        return memberService.findPager(userId,userName,kefuname,email,mobilePhone,begin_date,end_date,ru_userId,ru_userName,ru_mobilePhone,page);
    }

    public List<Map<String, Object>> findAll(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone) {
        return memberService.findAll(userId,userName,kefuname,email,mobilePhone,begin_date,end_date,ru_userId,ru_userName,ru_mobilePhone);
    }

    public int findCount(String userId, String userName, String kefuname, String email, String mobilePhone, String begin_date, String end_date, String ru_userId, String ru_userName, String ru_mobilePhone) {
        return memberService.findCount(userId,userName,kefuname,email,mobilePhone,begin_date,end_date,ru_userId,ru_userName,ru_mobilePhone);
    }

    public int countAllUser() {
        return memberService.countAllUser();
    }

    public int countAllUserTender() {
        return memberService.countAllUserTender();
    }

    public int update(Member member) {
        return memberService.update(member);
    }

    public int updatePayPwd(String pwd, int id) {
        return memberService.updatePayPwd(pwd,id);
    }

    public int findMyRecommendCount(Integer recommend_id) {
        return memberService.findMyRecommendCount(recommend_id);
    }

    public int findNotUserIdAndEmail(Integer id, String email) {
        return memberService.findNotUserIdAndEmail(id,email);
    }

    public int updateKefuByid(Integer user_id, String kefu_id) {
        return memberService.updateKefuByid(user_id,kefu_id);
    }

    public Member register(Member user) throws NoticeException {
        return memberService.register(user);
    }
}
